#include "common.h"

volatile struct gpio_reg *gpioa = (volatile struct gpio_reg *)0x40010800;
volatile struct gpio_reg *gpiob = (volatile struct gpio_reg *)0x40010c00;
volatile struct gpio_reg *gpioc = (volatile struct gpio_reg *)0x40011000;
volatile struct gpio_reg *gpiod = (volatile struct gpio_reg *)0x40011400;
volatile struct gpio_reg *gpioe = (volatile struct gpio_reg *)0x40011800;
volatile struct gpio_reg *gpiof = (volatile struct gpio_reg *)0x40011c00;
volatile struct gpio_reg *gpiog = (volatile struct gpio_reg *)0x40012000;
volatile struct afio_reg *afio  = (volatile struct afio_reg *)0x40010000;

void init_gpio(void)
{
    gpioa = (volatile struct gpio_reg *)0x40010800;
    gpiob = (volatile struct gpio_reg *)0x40010c00;
    gpioc = (volatile struct gpio_reg *)0x40011000;
    gpiod = (volatile struct gpio_reg *)0x40011400;
    gpioe = (volatile struct gpio_reg *)0x40011800;
    gpiof = (volatile struct gpio_reg *)0x40011c00;
    gpiog = (volatile struct gpio_reg *)0x40012000;
    afio  = (volatile struct afio_reg *)0x40010000;
    rcc->APB2ENR |= 0x1fd;
};
